﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ProjectFitus.Models.ArticleComment>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ArticleComments
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>ArticleComments</h2>


  <ul class ="Comment">
        <%foreach(var item in Model)
          {%>

         <li class="CommentLi">
                <div class="CommentBody">
                   <%: Html.ActionLink(item.User.userName, "details/"+item.commentedBy, "User") %>
                        <span><%: item.commentText  %></span>
                              <div>
                                   <abbr title='<%: item.dateCommented %>'><%: String.Format("{0:g}", item.dateCommented)%></abbr> 
                              </div>
                </div>
                        <%} %>
         </li>
  </ul>

  <% using (Html.BeginForm())
     {%>
        <%: Html.ValidationSummary(true)%>
        

  <ul class= "Comment">
			<li class="commentAdd">
            <input type="hidden" id="articleId" name="articleId" value="<%: Model.FirstOrDefault().articleId %>" />
				<textarea id="CommentText" name="CommentText" rows="2" cols="33"></textarea>
				<label>
                    <input type="submit" value="Skrifa athugasemd" id="athTakki"/>
				</label>
			</li>
		</ul>
        <%} %>



        
    <p>
        <%: Html.ActionLink("Back to List", "Index") %>
    </p>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="SideContent" runat="server">
</asp:Content>

